import Vue from 'vue'
import Vuex from 'vuex'
import persistedState from 'vuex-persistedstate'
Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    searchList:[]
  },
  getters: {
  },
  mutations: {
    add(state,obj){
      state.searchList.unshift(obj)
    },
    pop(state){
      state.searchList.pop()
    },
    detail(state,index){
      state.searchList.splice(index,1)
    },
    all(state){
      state.searchList=[]
    }
  },
  actions: {
  },
  modules: {
  },
  plugins: [persistedState()]
})
